package com.ymatou.iapi.productspu.service;

import java.util.List;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.productspu.parameter.PropertyOut;
import com.ymatou.iapi.productspu.parameter.SPUDTO;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取SPU属性列表
*FreeMaker Template自动生成代码
*/
public class GetSpuPropertyListCall extends YmatouBaseCall{
	private static String opurl ="api/Spu/GetSpuPropertyList";
	
	public GetSpuPropertyListCall() {
		super(EnvSetup.getSystemUrl("productspu_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<PropertyOut> getPropertyList(){
		String sspu=getJsonObject().get("Result").getAsJsonObject().get("PropertyList").toString();
		List<PropertyOut> pout = (List<PropertyOut>) FormatUtil.GSONToObject(sspu,new TypeToken<List<PropertyOut>>() {
		}.getType());
		return pout;
		
	}
}